home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pull70.zip / PULLWORK.PAS < prev    next >
Pascal/Delphi Source File  |  1993-06-21  |  4KB  |  138 lines

  1. { ========================================================================== }
  2. { Pullwork.pas - Work Window procedures for main work      ver 7.0, 06-21-93 }
  3. {                area for PULLDEMO.PAS                                       }
  4. { This file contains all the procedures executed for the Work Window.  These }
  5. { are the main steps of your program.  With this, you can create a sophisti- }
  6. { cated multi-level window environment.                                      }
  7. {   Copyright (c) 1988,1993 James H. LeMay, All rights reserved.             }
  8. { ========================================================================== }
  9.  
  10. {$i pulldefs.inc }
  11.  
  12. UNIT PullWork;
  13.  
  14. INTERFACE
  15.  
  16. procedure WorkWndw;
  17.  
  18.  
  19. IMPLEMENTATION
  20.  
  21. uses
  22.   Crt,Qwik,Wndw,Pull,PullStat
  23.   {$ifdef UseDataEntryCode }
  24.   ,PullData;
  25.   {$else }
  26.   ;
  27.   {$endif }
  28.  
  29. { ========================= Work Window Steps ============================== }
  30. { This procedure will have all the procedures for the Work window(s).        }
  31. { Each step assumes that some keystroke has been pressed and returns a value }
  32. { for Key and ExtKey and any necessary change to WorkWndwStep.               }
  33. { -------------------------------------------------------------------------- }
  34. var
  35.   Start1,Start2: word;
  36.  
  37. {$ifdef MultiWorkWndws }
  38. procedure ResetWorkWndwStep;
  39. begin
  40.   case TWS.WSname of
  41.     Window1:  WorkWndwStep := 1;
  42.     Window2:  WorkWndwStep := 3;
  43.   end;
  44. end;
  45.  
  46. procedure HideWorkWndw;
  47. begin
  48.   HideWindow;
  49.   TopWorkWndwName := TWS.WSname;
  50.   ResetWorkWndwStep;
  51. end;
  52.  
  53. procedure AccessWorkWndw (WN: WindowNames);
  54. begin
  55.   if WN<>TWS.WSname then
  56.     begin
  57.       { -- if accessing a PermMode window, hide all upper windows. -- }
  58.       if (GetLevelIndex(WN)<=PLI) then
  59.         while (LI>PLI) do
  60.           HideWindow;         { Use RemoveWindow for serial access }
  61.       AccessWindow (WN);
  62.       ResetWorkWndwStep;
  63.     end;
  64. end;
  65. {$endif }
  66.  
  67. procedure KbdIdle; far;
  68. begin
  69.   { Nothing to include this time, but fill in what you want to do while }
  70.   { the keyboard is idle. }
  71. end;
  72.  
  73. procedure ShowFields;
  74. begin
  75.   WWrite (14,10,'Byte:');
  76.   WWrite (15,10,'Word:');
  77.   WWrite (16,10,'ShortInt:');
  78.   WWrite (17,10,'Integer:');
  79.   WWrite (18,10,'LongInt:');
  80.   WWrite (19,10,'Real:');
  81.   WWrite (14,39,'Hex:');
  82.   WWrite (15,39,'Char:');
  83.   WWrite (16,39,'String:');
  84.   WWrite (17,39,'File name:');
  85.   DisplayFields (ord(aByte2DE),ord(FileNameDE));
  86. end;
  87.  
  88. procedure MakeWorkWndw2;
  89. begin
  90.   SetWindowModes (HiddenMode);
  91.   MakeWindow ( 8,21,10,40,LightBlue+LightGrayBG,LightBlue+LightGrayBG,
  92.                DoubleBrdr,Window2);
  93.   SetWindowModes (0);
  94.   WriteToHidden (Window2);
  95.   TitleWindow (Top   ,Left  ,SameAttr,'2');
  96.   TitleWindow (Top   ,Center,SameAttr,' Work Window 2 ');
  97.   TitleWindow (Bottom,Center,SameAttr,' Press ESC to Hide ');
  98.   WWriteC (1,'Type in any input');
  99.   WGotoRC (2,1);
  100.   WriteToCRT;
  101. end;
  102.  
  103. procedure EditFields;
  104. begin
  105.   { Only FileName may have been changed }
  106.   DisplayFields (ord(FileNameDE),ord(FileNameDE));
  107.   EnterSeq (ord(aByte2DE),ord(FileNameDE),Start1);
  108. end;
  109.  
  110. procedure InitWorkWndws;
  111. begin
  112.   ShowFields;
  113.   WorkWndwStep := 1;
  114.   Key := NullKey;  { #00 }
  115. end;
  116.  
  117. procedure WorkWndw;
  118. begin
  119.   {$ifdef MultiWorkWndws }
  120.   AccessWorkWndw (TopWorkWndwName);
  121.   {$endif }
  122.   case WorkWndwStep of
  123.     0:  InitWorkWndws;
  124.     1:  EditFields;
  125.   end;
  126. end;
  127.  
  128. BEGIN
  129.   WorkWndwStep := 0;          { Initial step for work windows. }
  130.   {$ifdef MultiWorkWndws }
  131.   TopWorkWndwName := Window1;
  132.   {$endif }
  133.   Start1 := ord(aByte2DE);
  134.   Start2 := ord(aHex2DE);
  135.   CallWorkWndw := WorkWndw;
  136.   CallKbdIdle  := KbdIdle;
  137. END.
  138.